package net.mysoft.budgetsoft.system.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**   
 *  
 * @author dagongPGP v1.0 
 * @link <a href=http://www.mysoft.net>北京大公信软科技有限公司</a> 
 *  
 * @version $Revision: 1.00  $Date: 2013-07-08 17:28:18 
 */
//@Entity
//@Table(name="FlowTemplateNode")
public class TFlowTemplateNode implements java.io.Serializable {  

	private static final long serialVersionUID = 1L;
	private String ftn_ID;
    private TFlowTemplate flowTemplate;
    private Integer ftn_StartupDefault;
    private String ftn_Name_cn;
    private String ftn_Name_en;
    private Integer ftn_Type;
    private TFlowNodeClass flowNodeClass;
    private Integer ftn_State;
    private Integer ftn_Index;
    private String ftn_PID;
    private String ftn_IndeptUserCode;
    private String ftn_IndeptComCode;
    private String ftn_IndeptRoleCode;
    private String ftn_Deadline;
    private String ftn_RemindInterval;
    private String ftn_DetractCode;
    private String ftn_TextName;
    private String ftn_FormUrl;
    private Integer ftn_XiangMuJD;
    private Integer ftn_UserNum;
    private Integer ftn_MustPass;
    private String ftn_ReturnTo;
    
    public String userCodes;
    
    private Set<TFlowTaskNode> flowTaskNodeSet;
	@OneToMany(cascade = CascadeType.DETACH, fetch = FetchType.LAZY, mappedBy="flowTemplateNode")
	public Set<TFlowTaskNode> getFlowTaskNodeSet() {
		return flowTaskNodeSet;
	}
	public void setFlowTaskNodeSet(Set<TFlowTaskNode> flowTaskNodeSet) {
		this.flowTaskNodeSet = flowTaskNodeSet;
	}
	@Id 
    @Column(name="FTN_ID", unique=true, nullable=false)
    public String getFtn_ID(){
    	return this.ftn_ID;
    }
    public void setFtn_ID(String fTN_ID){
    	this.ftn_ID = fTN_ID;
    }
    @Column(name="FTN_MustPass")
    public Integer getFtn_MustPass() {
		return ftn_MustPass;
	}
	public void setFtn_MustPass(Integer ftn_MustPass) {
		this.ftn_MustPass = ftn_MustPass;
	}
	@Column(name="FTN_ReturnTo")
	public String getFtn_ReturnTo() {
		return ftn_ReturnTo;
	}
	public void setFtn_ReturnTo(String ftn_ReturnTo) {
		this.ftn_ReturnTo = ftn_ReturnTo;
	}
	@Column(name="FTN_UserNum")
    public Integer getFtn_UserNum() {
		return ftn_UserNum;
	}

	public void setFtn_UserNum(Integer ftn_UserNum) {
		this.ftn_UserNum = ftn_UserNum;
	}

	@Column(name="FTN_XiangMuJD",nullable=true)
	public Integer getFtn_XiangMuJD() {
		return ftn_XiangMuJD;
	}

	public void setFtn_XiangMuJD(Integer ftn_XiangMuJD) {
		this.ftn_XiangMuJD = ftn_XiangMuJD;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FTL_ID",nullable=true)
    public TFlowTemplate getFlowTemplate() {
		return flowTemplate;
	}

	public void setFlowTemplate(TFlowTemplate flowTemplate) {
		this.flowTemplate = flowTemplate;
	}

    @Column(name="FTN_Name_cn",nullable=true)
    public String getFtn_Name_cn(){
    	return this.ftn_Name_cn;
    }

	public void setFtn_Name_cn(String fTN_Name_cn){
    	this.ftn_Name_cn = fTN_Name_cn;
    }
    
    @Column(name="FTN_Name_en",nullable=true)
    public String getFtn_Name_en(){
    	return this.ftn_Name_en;
    }
    
    public void setFtn_Name_en(String fTN_Name_en){
    	this.ftn_Name_en = fTN_Name_en;
    }
    
    @Column(name="FTN_Type",nullable=true)
    public Integer getFtn_Type(){
    	return this.ftn_Type;
    }
    
    public void setFtn_Type(Integer fTN_Type){
    	this.ftn_Type = fTN_Type;
    }
    
    @Column(name="FTN_StartupDefault",nullable=true)
    public Integer getFtn_StartupDefault() {
		return ftn_StartupDefault;
	}

	public void setFtn_StartupDefault(Integer ftn_StartupDefault) {
		this.ftn_StartupDefault = ftn_StartupDefault;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FTN_Class",nullable=true)
    public TFlowNodeClass getFlowNodeClass() {
		return flowNodeClass;
	}

	public void setFlowNodeClass(TFlowNodeClass flowNodeClass) {
		this.flowNodeClass = flowNodeClass;
	}

    @Column(name="FTN_State",nullable=true)
    public Integer getFtn_State(){
    	return this.ftn_State;
    }

	public void setFtn_State(Integer fTN_State){
    	this.ftn_State = fTN_State;
    }
    
    @Column(name="FTN_Index",nullable=true)
    public Integer getFtn_Index(){
    	return this.ftn_Index;
    }
    
    public void setFtn_Index(Integer fTN_Index){
    	this.ftn_Index = fTN_Index;
    }
    
	@Column(name = "FTN_PID",nullable=true)
	public String getFtn_PID() {
		return ftn_PID;
	}

	public void setFtn_PID(String ftn_PID) {
		this.ftn_PID = ftn_PID;
	}

	@Column(name="FTN_IndeptUserCode",nullable=true)
    public String getFtn_IndeptUserCode(){
    	return this.ftn_IndeptUserCode;
    }

	public void setFtn_IndeptUserCode(String fTN_IndeptUserCode){
    	this.ftn_IndeptUserCode = fTN_IndeptUserCode;
    }
    
    @Column(name="FTN_IndeptComCode",nullable=true)
    public String getFtn_IndeptComCode(){
    	return this.ftn_IndeptComCode;
    }
    
    public void setFtn_IndeptComCode(String fTN_IndeptComCode){
    	this.ftn_IndeptComCode = fTN_IndeptComCode;
    }
    
    @Column(name="FTN_IndeptRoleCode",nullable=true)
    public String getFtn_IndeptRoleCode(){
    	return this.ftn_IndeptRoleCode;
    }
    
    public void setFtn_IndeptRoleCode(String fTN_IndeptRoleCode){
    	this.ftn_IndeptRoleCode = fTN_IndeptRoleCode;
    }
    
    @Column(name="FTN_Deadline",nullable=true)
    public String getFtn_Deadline(){
    	return this.ftn_Deadline;
    }
    
    public void setFtn_Deadline(String fTN_Deadline){
    	this.ftn_Deadline = fTN_Deadline;
    }
    
    @Column(name="FTN_RemindInterval",nullable=true)
    public String getFtn_RemindInterval(){
    	return this.ftn_RemindInterval;
    }
    
    public void setFtn_RemindInterval(String fTN_RemindInterval){
    	this.ftn_RemindInterval = fTN_RemindInterval;
    }
    
    @Column(name="FTN_DetractCode",nullable=true)
    public String getFtn_DetractCode(){
    	return this.ftn_DetractCode;
    }
    
    public void setFtn_DetractCode(String fTN_DetractCode){
    	this.ftn_DetractCode = fTN_DetractCode;
    }
    
    @Column(name="FTN_TextName",nullable=true)
    public String getFtn_TextName(){
    	return this.ftn_TextName;
    }
    
    public void setFtn_TextName(String fTN_TextName){
    	this.ftn_TextName = fTN_TextName;
    }
    
    @Column(name="FTN_FormUrl",nullable=true)
    public String getFtn_FormUrl(){
    	return this.ftn_FormUrl;
    }
    
    public void setFtn_FormUrl(String fTN_FormUrl){
    	this.ftn_FormUrl = fTN_FormUrl;
    }
    
	
    @Override
    public int hashCode() {
    	int prime = 0;
        prime +=this.getFtn_ID().hashCode();
        return prime;
    }

    @Override
    public boolean equals(Object obj) {
    	boolean isEquals = false;
    	if(obj!=null&&this.getClass()==obj.getClass()){
    		TFlowTemplateNode clazz = (TFlowTemplateNode)obj;
            if(clazz.getFtn_ID().equals(this.getFtn_ID()))
            	isEquals = true;
    		return isEquals;
    	}
        return isEquals;
    }

}